package com.boot2.core.exception;

import com.boot2.core.web.RequestContext;
import lombok.extern.apachecommons.CommonsLog;

import javax.servlet.http.HttpServletRequest;

/**
 * 
 * 
 * @ClassName: BusinessException
 * @description: 找不到调度任务
 * @author zhangweilin
 * @date 2017年12月19日 下午4:54:48
 *
 */
@CommonsLog
public class NuSuchSchedulerTaskException extends RuntimeException {
	/**
	 *
	 */
	private static final long serialVersionUID = -3877531184268150162L;

	public NuSuchSchedulerTaskException(String message, String... paras) {
		super(String.format(message, paras));
		HttpServletRequest request = RequestContext.getRequest();
		if (null==request) {
			log.error(String.format(message, paras));
		}
	}

	public NuSuchSchedulerTaskException(String message) {
		super(message);
		HttpServletRequest request = RequestContext.getRequest();
		if (null==request) {
			log.error(message);
		}
	}

	public NuSuchSchedulerTaskException(String message, Throwable e, String... paras) {
		super(String.format(message, paras), e);
		HttpServletRequest request = RequestContext.getRequest();
		if (null==request) {
			log.error(String.format(message, paras), e);
		}
	}

	public NuSuchSchedulerTaskException(String message, Throwable e) {
		super(message, e);
		HttpServletRequest request = RequestContext.getRequest();
		if (null==request) {
			log.error(message, e);
		}
	}

}
